---
title: 'Get API'
description: 'Retrieve information about an API'
---

Pass the optional and required parameters as per the official [API docs](https://unkey.com/docs/api-reference/apis/list-keys). See the DTO reference below for more information.

```java
package com.example.myapp;

import com.unkey.unkeysdk.dto.GetAPIResponse;

@RestController
public class APIController {

    private static IAPIService apiService = new APIService();

    @GetMapping("/get-api")
    public GetAPIResponse getAPI(
            @RequestParam String apiId,
            @RequestHeader("Authorization") String authToken) {
        // Delegate the creation of the key to the IAPIService from the SDK
        return apiService.getAPI(apiId, authToken);
    }
}

```

### DTOs Reference

The DTOs used in the code for a better understanding of request and response bodies.

#### Response

```java
public class GetAPIResponse {
    private String id;
    private String name;
    private String workspaceId;
}
```
